const permission = {
    state: {
        // 页面权限路径集合(拥有的页面)
        pagePathPermission: [],
        // 页面权限
        pagePermission: [],
        // 按钮权限(允许调用的接口或拥有的按钮)
        buttonPermission: [],
        // 角色权限(拥有的角色)
        rolePermission: [],
        //     全部菜单
        allMenus: []
    },
    mutations: {
        pagePathPermission(state, value) {
            state.pagePathPermission = value;
        },
        pagePermission(state, value) {
            state.pagePermission = value;
        },
        buttonPermission(state, value) {
            state.buttonPermission = value;
        },
        rolePermission(state, value) {
            state.rolePermission = value;
        },
        allMenus(state, value) {
            state.allMenus = value;
        },
    },
    actions: {
        pagePathPermission({commit}, value) {
            commit("pagePathPermission", value)
        },
        pagePermission({commit}, value) {
            commit("pagePermission", value)
        },
        buttonPermission({commit}, value) {
            commit("buttonPermission", value)
        },
        rolePermission({commit}, value) {
            commit("rolePermission", value)
        },
        allMenus({commit}, value) {
            commit("allMenus", value)
        },
    }
}

export default permission;
